package servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import entity.FinancingProduct;
import service.FinancingProductService;

public class idServlet extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html;charset=utf-8");
		String id= request.getParameter("id");
		int risk = Integer.parseInt(request.getParameter("risk"));
		FinancingProductService finsce=new FinancingProductService();
		List<FinancingProduct> list=finsce.Listlike(id, risk);
		request.setAttribute("list", list);
		request.getRequestDispatcher("List.jsp").forward(request, response);
	}
	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		this.doGet(request, response);
	}
}
